package cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @program: jvm
 * @description
 * @author: tkk fendoukaoziji
 * @create: 2019-01-30 14:20
 **/
public class HelloMethodInterceptor  implements MethodInterceptor {
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("Before:" +method.getName());
        Object object = methodProxy.invokeSuper(o, objects);
        System.out.println("After:"+method.getName());
        return object;
    }
}















